const express = require('express');
const router = express.Router();

// 导入路由模块
const userRoutes = require('./userRoutes');
const familyMemberRoutes = require('./familyMemberRoutes');
const healthRecordRoutes = require('./healthRecordRoutes');
const healthReminderRoutes = require('./healthReminderRoutes');
const healthReportRoutes = require('./healthReportRoutes');
const healthKnowledgeRoutes = require('./healthKnowledgeRoutes');
const healthTrendRoutes = require('./healthTrendRoutes');
const uploadRoutes = require('./uploadRoutes');

// 注册路由
router.use('/users', userRoutes);
router.use('/members', familyMemberRoutes);
router.use('/records', healthRecordRoutes);
router.use('/reminders', healthReminderRoutes);
router.use('/reports', healthReportRoutes);
router.use('/knowledge', healthKnowledgeRoutes);
router.use('/trends', healthTrendRoutes);
router.use('/upload', uploadRoutes);

// 测试路由
router.get('/test', (req, res) => {
  res.json({ message: 'API 测试成功' });
});

module.exports = router; 